﻿@page
@{ Layout = "_Layout"; }

<div style="padding:0 8px;">
    <el-form v-on:submit.native.prevent :inline="true" :size="euiSize">
        <el-form-item label="关键字">
            <el-input v-model="formEvaluation.keyWords" placeholder="组织、用户名、姓名" prefix-icon="el-icon-search" clearable></el-input>
        </el-form-item>
        <el-form-item>
            <el-button :size="euiSize" icon="el-icon-search" type="primary" v-on:click="btnEvaluationSearchClick">查 询</el-button>
            <el-button :size="euiSize" plain type="primary" icon="el-icon-download" v-on:click="btnEvaluationExportClick">
                导 出
            </el-button>
        </el-form-item>
    </el-form>
    <el-table ref="evaluationTable" :data="evaluationList" :size="euiSize"
              style="width: 100%">
        <el-table-column label="#"
                         type="index"
                         width="60"
                         align="left">
            <template scope="scope">
                <span>{{(formEvaluation.pageIndex - 1) * formEvaluation.pageSize + scope.$index + 1}}</span>
            </template>
        </el-table-column>
        <el-table-column label="账号">
            <template slot-scope="scope">
                <el-link :underline="false" type="primary" v-on:click="btnViewClick(scope.row.user.id)">{{scope.row.user.userName}}</el-link>
            </template>
        </el-table-column>
        <el-table-column prop="user.displayName" label="姓名">
        </el-table-column>
        <el-table-column prop="user.organNames" label="组织" show-overflow-toolti>
        </el-table-column>
        <el-table-column label="平均分">
            <template slot-scope="scope">
                {{ scope.row.avgEvaluation }}
                <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" class="bi bi-star-fill text-warning" viewBox="0 0 16 16">
                    <path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"></path>
                </svg>
            </template>
        </el-table-column>
        <el-table-column label="评价项">
            <el-table-column v-for="(item,itemIndex) in evaluationItems"
                             v-if="evaluationItems"
                             :key="item.id"
                             :column-key="item.id"
                             :label="item.title">
                <template slot-scope="scope">
                    <template v-if="scope.row.items[itemIndex].textContent">
                        {{ scope.row.items[itemIndex].contentValue }}
                    </template>
                    <template v-else>
                        {{ scope.row.items[itemIndex].starValue }}
                        <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" fill="currentColor" class="bi bi-star-fill text-warning" viewBox="0 0 16 16">
                            <path d="M3.612 15.443c-.386.198-.824-.149-.746-.592l.83-4.73L.173 6.765c-.329-.314-.158-.888.283-.95l4.898-.696L7.538.792c.197-.39.73-.39.927 0l2.184 4.327 4.898.696c.441.062.612.636.282.95l-3.522 3.356.83 4.73c.078.443-.36.79-.746.592L8 13.187l-4.389 2.256z"></path>
                        </svg>
                    </template>
                </template>
            </el-table-column>
        </el-table-column>
        @await Html.PartialAsync("_PartialTableEmpty")
    </el-table>
    <div style="text-align: center; margin-top: 10px;">
        <el-pagination v-on:current-change="evaluationHandleCurrentChange" background
                       :current-page="formEvaluation.pageIndex"
                       :page-size="formEvaluation.pageSize"
                       layout="total, prev, pager, next"
                       :total="evaluationTotal">
        </el-pagination>
    </div>
</div>

@section Scripts{
    <script src="/sitefiles/assets/js/admin/study/studyCourseManagerEvaluation.js" type="text/javascript"></script>
}